<?php
require_once(dirname(dirname(__FILE__)) . '/app.php');

need_login();

if($_GET['action']=='del' && $oauthMap[34] != null && !empty($_GET['id']) ){
	Staff::SetStaffUnactive($_GET['id']);
}

$shopList = Shop::GetAllShops();
$shopIdList = array();

$serviceList = Service::GetAll();
$serviceIdList = array();
foreach($serviceList as $k => $v){
	$serviceIdList[ $v['id'] ] = $v['service_name'];
}

foreach($shopList as $k => $v){
	$shopIdList[ $v['id'] ] = $v['shop_name'];
}

$defaultShopId = 1;
if($_GET['shop_id'] != null){
	$defaultShopId = abs( intval( $_GET['shop_id'] ) );
}
if( $defaultShopId == 0 ){
	$staffList = Staff::GetAll();
}else{
	$staffList = Staff::GetAllByShop($defaultShopId);
}


$staffSkill = array();
foreach($staffList as $k => $v){
	$staffSkill[ $v['id'] ] = StaffSkill::GetSkillsByStaffId($v['id']);
}
if( $oauthMap[30] == null){
	exit;
}


include template('/service/service_staff_list');


//include template('service_staff_index');
//include template('subscribe');
